<script lang="ts" setup>
import ServiceInfo from "./ServiceInfo.vue";
import { ref } from "vue";
import FormBase from "./FormBase.vue";
import { useRouter } from "vue-router";
const router = useRouter();

const submit = () => {
    router.push({
        path: "/cart/confirmOrder",
    });
};

const handleChange = (value: string) => {
    console.log(`selected ${value}`);
};

const value1 = ref("3");
</script>
<template>
  <FormBase @submit="submit">
    <template #beforeSubmit>
      <div>
        <h3 class="mt-5 mb-5 font-bold">
            购买时长
        </h3>
        <a-select
          ref="select"
          v-model:value="value1"
          style="width: 120px"
          @change="handleChange"
        >
          <a-select-option value="3">一年</a-select-option>
          <a-select-option value="2">两年</a-select-option>
          <a-select-option value="1">三年</a-select-option>
        </a-select>
      </div>
    </template>
    <template #form>
      <ServiceInfo />
    </template>
  </FormBase>
</template>
<style lang="scss" scoped></style>
